﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SU.Center.Api.Utils;

namespace SU.Center.Api.Controllers
{
    /// <summary>
    /// 短信
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class UtilssController : ControllerBase
    {
        private readonly SmsClientFactory smsClientFactory;

        public UtilssController(SmsClientFactory smsClientFactory)
        {
            this.smsClientFactory = smsClientFactory;
        }

        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <param name="message">短信内容</param>
        [HttpGet("SendSms")]
        public void SendSms()
        {
            smsClientFactory.SendSms("15297563636", "{\"code\":\"1234\"}", "阿里云短信测试", "SMS_154950909");
        }
    }
}
